<%-- 
    Document   : Collection
    Created on : 2020-4-18, 15:43:47
    Author     : zhang
--%>

<%@page import="service.FindCollection"%>
<%@page import="java.util.List"%>
<%@page import="entity.Book"%>
<%@page import="entity.Member"%>
<%@page import="dao.MemberDao"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            String username=(String)session.getAttribute("username");
        %>
        <h1>收藏夹</h1><h3><a href="ccs?username=<%=username%>">清空收藏夹</a></h3>
        <div style="position: absolute;left:300px;top:50px"><a href="Member.jsp?name=<%=username%>">返回个人主页</a></div>
        <%
            String name=request.getParameter("name");
            Member member=new MemberDao().getMemberByName(name);
            
            
            List<Book> list=new FindCollection().findCollection(member.getId());
            for(Book book:list){
        %>
            <div>
                <h3><%=book.getBookName()%></h3>
                <div style="width: 200px;height:300px;border:1px solid #000">
                    <img src="img/<%=book.getCover()%>" width="200px" height="300px" alt="<%=book.getBookName()%>">
                </div>
                <div style="width: 300px;height:250px" >
                    <p>编号：<%=book.getId()%></p>
                    <p>作者：<%=book.getAuthor()%></p>
                    <p>出版日期：<%=book.getPublishDate()%></p>
                    <p>出版社：<%=book.getPublishHouse()%></p>
                    <a href="gbbi?id=<%=book.getId()%>">查看更多</a>
                    <a href="dcs?id=<%=book.getId()%>">取消收藏</a>
                </div>
                
            </div>
                
            <%
                }
            %>
    </body>
</html>
